<%@ page import="userDao.User" %>
<%@ page import="java.util.List" %>
<%@ page import="userDao.Student" %>
<%--
  Created by IntelliJ IDEA.
  User: Ly
  Date: 2021/3/29
  Time: 13:57
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>学生管理界面</title>
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
</head>
<body>
<%
    List<Student> students = (List<Student>) session.getAttribute("students");
    //Object getStudent = request.getAttribute("getStudent");
%>
<h1 style="text-align: center">登录成功！欢迎进入学生管理界面！</h1><br>
<div> <%= request.getAttribute("getStudent") == null?"":request.getAttribute("getStudent") %> </div>
<div class="btn-group" style="margin: auto;" >
<a href="${pageContext.request.contextPath}/addStudent.jsp"><button class="btn btn-success" id="addStudent">添加学生</button></a>
<a href="${pageContext.request.contextPath}/deleteStudent.jsp"><button class="btn btn-success" id="deleteStudent">删除学生</button></a>
<a href="${pageContext.request.contextPath}/editStudent.jsp"><button class="btn btn-success" id="eidtStudent">编辑学生</button></a>
<a href="${pageContext.request.contextPath}/lookUpStudent.jsp"><button class="btn btn-success" id="lookUpStudent">查找学生</button></a>
<a href="${pageContext.request.contextPath}/groupView.jsp"><button class="btn btn-success" id="group">班级管理</button></a>
</div>
<div>
<table class="table">
     <thead>
        <tr>
            <th>id</th>
            <th>name</th>
            <th>sex</th>
            <th>date</th>
            <th>mail</th>
            <th>message</th>
            <th>groupNum</th>
        </tr>
     </thead>
     <tbody>
     <% for (int i = 0;i < students.size();i++){%>
     <tr>

     <td><%= students.get(i).getId()%></td>
     <td><%= students.get(i).getName()%></td>
     <td><%= students.get(i).getSex()%></td>
     <td><%= students.get(i).getDate()%></td>
     <td><%= students.get(i).getMail()%></td>
     <td><%= students.get(i).getMessage()%></td>
     <td><%= students.get(i).getGroupNum()%></td>

     </tr>
     <%}%>

     </tbody>
 </table>
</div>



</body>
<script src="bootstrap/js/jquery-3.3.1.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>

<script>
</script>
</html>
